package com.yihaodian.search.controller;

import com.yihaodian.index.meta.shard.Shard;

public class ShardDoc implements Comparable<ShardDoc>{
	private Shard shard;

    private int docId;

    private float score;

	public Shard getShard() {
		return shard;
	}

	public void setShard(Shard shard) {
		this.shard = shard;
	}

	public int getDocId() {
		return docId;
	}

	public void setDocId(int docId) {
		this.docId = docId;
	}

	public float getScore() {
		return score;
	}

	public void setScore(float score) {
		this.score = score;
	}
	
	@Override
	public int compareTo(ShardDoc o) {
		int result = (int)(o.score - this.score);
		if (result == 0) {
			result = o.docId - this.docId;
		}
		
		return result;
	}
}
